package com.decent.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 系统级配置
 *
 * @author wangyx
 */
@Data
@Component
@ConfigurationProperties(prefix = "decent")
public class DecentSystemConfig {
    private final DecentSystemConfig.XssConfig xssConfig;

    public DecentSystemConfig() {
        this.xssConfig = new DecentSystemConfig.XssConfig();
    }

    @Data
    public static class XssConfig {
        /**
         * xss防御级别，HIGH：高级别；LOW：低级别；
         */
        private XssLevelEnum xssProtectLevel;
        /**
         * xss过滤器不过滤路径：img、.css、.js、.html等
         */
        private String excludeXssPatterns;

        /**
         * xss防御级别
         */
        public enum XssLevelEnum {
            HIGH,LOW
        }
    }
}
